﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Inverntory_Target_Customer.aspx.cs" MasterPageFile="~/MasterPage.master"
    Inherits="Inverntory_Target_Customer" %>

<%@ Register src="../UserControl/GridPager.ascx" tagname="GridPager" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>安全库存客户维护</title>
    <script src="../JavaScript/empchecks.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
    function CheckList(ckb,lbl,newName)
    {
        var ckbSelect=document.getElementById(ckb);
        var lblName=document.getElementById(lbl);
        if(ckbSelect.checked)
        {
            if(lblName.innerText.length>0&&lblName.innerText!=newName)
            {
                if(!confirm('是否覆盖现有库存目标计算公式?'))
                {
                    ckbSelect.checked=false;
                }
            }
        }
    }
    
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div>
        <table id="wsd_inputtable">
            <tr>
                <td width="100%" class="tabletitle" colspan="6">
                    搜索选项
                </td>
            </tr>
            <tr>
                <td class="tablefield">
                    客户类别:
                </td>
                <td nowrap="nowrap">
                    <asp:DropDownList runat="server" ID="ddlClass" Width="130">
                    </asp:DropDownList>
                </td>
                <td class="tablefield">
                    销售渠道:
                </td>
                <td nowrap="nowrap">
                    <asp:DropDownList runat="server" ID="ddlChannel" Width="130">
                    </asp:DropDownList>
                </td>
                <td class="tablefield">
                    经销商:
                </td>
                <td nowrap="nowrap">
                    <asp:DropDownList runat="server" ID="ddlChain" Width="130">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="tablefield">
                    分配类型:
                </td>
                <td nowrap="nowrap">
                    <asp:DropDownList runat="server" ID="ddlSelected" Width="130">
                        <asp:ListItem Text="--所有--" Value="0"></asp:ListItem>
                        <asp:ListItem Text="--已分配--" Value="1"></asp:ListItem>
                        <asp:ListItem Text="--未分配--" Value="2"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                 <td class="tablefield">
                    客户代码或名称:
                </td>
                <td nowrap="nowrap">
                
                    <asp:TextBox runat="server" ID="txtCustomer" MaxLength="20" Width="130px"></asp:TextBox>
                
                </td>
                                 <td class="tablefield">

                </td>
                <td nowrap="nowrap">
                
                </td>
            </tr>
            <tr>
                <td class="buttonarea" colspan="6">
                    <asp:Button ID="btnQuery" runat="server" class="wsd_button2" Text="查  询" OnClick="btnQuery_Click" />
                    &nbsp;&nbsp;
                    <input  type="button" class="wsd_button2" size="47" value="重  置" name="reset" onclick="clearForm('form1')"/>
                </td>
            </tr>
        </table>
        <br />
        <table id="wsd_inputtable">
            <tr>
                <td class="tabletitle">
                    客户列表 安全库存计算公式:<asp:Label runat="server" ID="lblListName"></asp:Label>
                </td>
            </tr>
        </table>
        <table id="wsd_listtable" width="100%">
            <tr>
                <td style="width: 100%">
                    <asp:GridView Width="100%" ID="GridView1" runat="server" 
                        AutoGenerateColumns="false" EmptyDataText="没有可显示的数据." 
                    EmptyDataRowStyle-Font-Bold="true" EmptyDataRowStyle-HorizontalAlign="Center"   
                        EnableEmptyContentRender="true" 
                        OnRowDataBound="gvChannelType_RowDataBound" AllowPaging="True" 
                        PageSize="50">
                        <HeaderStyle CssClass="titlist" />

<EmptyDataRowStyle HorizontalAlign="Center" Font-Bold="True"></EmptyDataRowStyle>
                        <Columns>
                            <asp:TemplateField HeaderText="ID" Visible="false">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblID" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="" DataField="ID" Visible="false" />
                            <asp:BoundField HeaderText="客户代码" DataField="CODE" />
                            <asp:BoundField HeaderText="门店名称" DataField="NAME" />
                            <asp:BoundField HeaderText="客户地址" DataField="ADDRESS_LINE" />
                            <asp:BoundField HeaderText="区域层次" DataField="Level" />
                            <asp:BoundField HeaderText="经销商" DataField="Chain" Visible="false" />
                            <asp:BoundField HeaderText="连锁门店" DataField="Banner" Visible="false" />
                            <asp:BoundField HeaderText="客户类型" DataField="CustomerClass" />
                            <asp:BoundField HeaderText="销售渠道" DataField="Channel" />
                            <asp:BoundField HeaderText="地址" DataField="ADDRESS_LINE" />
                            <asp:TemplateField HeaderText="库存目标">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblListName" Text='<% #Eval("CUSTOMER_PRODUCT_NAME") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <input type="checkbox" id="chkAll" name="chkAll" onclick="Check(this,'cbxSelected')" />全选
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbxSelected" runat="server" Checked='<%# Convert.ToBoolean(Eval("Selected")) %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <RowStyle CssClass="evenline" />
                        <AlternatingRowStyle CssClass="oddline" />
                        <PagerSettings Visible="true" />
                    </asp:GridView>
                    <br />
                    <uc1:GridPager ID="GridPager1" runat="server" />
                </td>
            </tr>
        </table>
        <br />
        <table id="wsd_inputtable">
            <tr>
                <td width="100%" class="tabletitle" >
                    操作选项
                </td>
            </tr>
            <tr>
                <td class="buttonarea">
                    <asp:Button ID="btnSubmiet" runat="server" class="wsd_button2" Text="提  交" OnClick="btnSubmit_Click" />&nbsp;&nbsp;
                    <input class="wsd_button2" onclick="location.href='Inventory_Target_List.aspx'" 
                            type="button" value="返  回" />
                </td>
            </tr>
        </table>
    </div>
 </asp:Content>

